home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
wfc007.000
/
include
/
serial.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-08
|
1KB
|
57 lines
#ifndef SERIAL_FILE_CLASS_HEADER
/*
** Author: Samuel R. Blackburn
** CI$: 76300,326
** Internet: sammy@sed.csc.com
**
** You can use it any way you like.
*/
#define SERIAL_FILE_CLASS_HEADER
class CSerialFile : public CDummyFile
{
DECLARE_SERIAL( CSerialFile )
private:
void m_Initialize( void );
protected:
BOOL m_IsOpen;
DWORD m_CommunicationErrorCodes;
COMSTAT m_CommunicationsStatus;
virtual void m_ClearError( int line_number = 0 );
public:
CSerialFile();
/*
** Destructor should be virtual according to MSJ article in Sept 1992
** "Do More with Less Code:..."
*/
virtual ~CSerialFile();
CString Name; // COM1:9600,n,8,1
HANDLE FileHandle;
virtual BOOL Open( void ); // Name already filled, used in re-opening an existing session
virtual BOOL Open( const char *channel_name, UINT open_flags = 0, CFileException* pError = NULL );
virtual void Close( void );
virtual BOOL IsDataWaiting( void );
virtual UINT Read( void *buffer, UINT length );
virtual void Serialize( CArchive& archive );
virtual void Write( CString& data_to_write );
virtual void Write( const void *buffer, UINT number_of_bytes );
};
#endif // SERIAL_FILE_CLASS_HEADER